/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.icanci.operation.mapper;

import cn.icanci.operation.entity.Ticket;
import cn.icanci.operation.form.UserSearchForm;

import java.util.List;

import org.apache.ibatis.annotations.Param;

/**
 * @author icanci
 * @date Created in 2021/04/29 22:12
 * @version 1.0
 */
public interface TicketMapper {
    /**
     * 批量插入
     * @param list 更新插入
     * @return 返回
     */
    int insertManyRow(List<Ticket> list);

    /**
     * 查询
     * @param flightNumber 查询
     * @return 返回
     */
    int queryNumberByFlightNumber(String flightNumber);

    /**
     * 查询所有航班信息
     * @return 返回查询的结果
     */
    List<String> queryFlightNumberManyRow();

    /**
     * 根据航班号查询一条
     * @param flightNumber 航班号
     * @return 查询一条
     */
    Ticket queryOneByFlightNumber(String flightNumber);

    /**
     * 机票的状态
     * @param status
     * @param flightNumber
     * @return
     */
    int queryNumberByStatus(@Param("status") Integer status, @Param("flightNumber") String flightNumber);
    /**
     * 根据航班号查询所有
     * @param flightNumber 航班号
     * @return 查询所有
     */
    List<Ticket> queryAllByFlightNumber(String flightNumber);

    /**
     * 查询
     * @param userSearchForm
     * @return
     */
    List<Ticket> userQueryTicket(UserSearchForm userSearchForm);

    /**
     * 查询一条
     * @param userSearchForm
     * @return
     */
    List<Ticket> userOneQueryTicket(UserSearchForm userSearchForm);

    /**
     * 查询一条数据
     * @param id
     * @return
     */
    Ticket queryTicketDetailDataById(Long id);

    /**
     * 更新
     * @param ticket
     */
    void updateTicketDetailDataById(Ticket ticket);
}
